# -*- coding: utf-8 -*-
from rest_framework.pagination import PageNumberPagination

from utils.common.base_response import APIResponse


class BasePageNumberPagination(PageNumberPagination):
    def get_paginated_response(self, data):
        return APIResponse(data={
            'next': self.get_next_link(),
            'previous': self.get_previous_link(),
            'count': self.page.paginator.count,  # 添加count字段
            'results': data
        })